<?php
defined('SEJUJOPEFDNGJSL') or exit('Access denied');
// 处理删除操作
$action=$_GET['action'];
$psid=$_GET['id'];
if ($action=="del"){
  
  $db->sitedbexec("delete from ld_product where id='".$psid."'");
  $db->sitedbexec("delete from ld_rks where productid='".$psid."'");
  show_automsg('删除成功',YMCURL.'products');

}
?>
<link rel="stylesheet" type="text/css" href="../css/pintuer.css">
<link rel="stylesheet" type="text/css" href="../css/admin.css">
<link rel="stylesheet" type="text/css" href="../css/manage.css">

<div class="righttop">
  <span class="icon-home"></span> 首页 <span class="gray">/</span> 产品管理
</div>
<div class="panelbox">
    <div class="panel admin-panel">
        <div class="panel-head">
          <strong><span class="icon-shopping-cart"></span>
             产品列表
          </strong>
        </div>
        <div class="padding border-bottom" style="height: auto;overflow: hidden;">
          <ul class="search" style="float: left;">
            <li>
              <span class="button border-green colorgreen" id="checkall">
                <span class="icon-check-square-o"></span>
                <a href="main.php?lsaction=productsadd">添加产品</a>
              </span>
            </li>
          </ul>
        </div>
        <div class="body-content" style="padding:0px;">
          <!-- 表格表格 -->
          <table class="table table-hover text-center">
              <tr>
                <th>编号</th>
                <th>图片</th>
                <th>产品名称</th>
                <th>价格</th>
                <th>库存</th>
                <th>添加时间</th>
                <th>操作</th>
              </tr>
            <?php     
              $db->query("select * from ld_product");
              $plist=$db->rs;
              $pageno=1;
              foreach ($plist as $key => $rs) {
            
             ?>
              <tr>
                <td><?php echo $rs["id"]?></td>
                <td>
                  <?php 
                  if(!empty($rs["proimg"])){?>
                    <a href="<?php echo $rs["proimg"]?>" target="_blank">
                    <img src="<?php echo $rs["proimg"]?>" height="60" border="0" /></a>
                  <?php 
                  }else echo "无";
                  ?>
                </td>
              <td><?php echo $rs["productname"]?></td>
              <td><?php echo $rs["price"]?> </td>
              <td><?php echo $rs["num"]?></td>
              <td><?php echo date("y-m-d",$rs["addtime"])?></td>
              <td>
                      <a href="main.php?lsaction=productview&id=<?php echo $rs["id"]?>">查看</a>
                      &nbsp;|&nbsp;
                      <a href="main.php?lsaction=productin&prid=<?php echo $rs["id"]?>&tag=1">入库</a>
                      &nbsp;|&nbsp;
                      <a href="main.php?lsaction=productsadd&action=edit&id=<?php echo $rs["id"]?>">修改</a>
                      &nbsp;|&nbsp;
                      <a href="main.php?lsaction=products&action=del&id=<?php echo $rs["id"]?>&pageno=<?php echo $pageno?>" onClick="return confirm('确定删除?');">删除</a>
                    <!-- 判断结束 -->
              </td>
              </tr>
              <?php
              }
              ?>
                  <tr>
                        <td height="20" bgcolor="#FFFFFF" colspan="11"><div align="center"></div></td>
                      </tr>
            </table>
            <table class="table table-hover text-center">
              <tr>
                <td>
                </td>
              </tr>
            </table>
          <!-- 结束结束 -->
        </div>
    </div>
</div>
